package com.chen.staffjoy.company.controller;

import com.chen.staffjoy.commonlib.base.BaseController;
import com.chen.staffjoy.company.entity.Team;
import com.chen.staffjoy.company.service.ITeamService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 企业团队信息表 Controller
 *
 * @author ChenTian
 */ 
@RestController
@RequestMapping("/team")
public class TeamController extends BaseController {

	@Resource
	private ITeamService teamService;

	@GetMapping("/getById/{id}")
	public Team getById(@PathVariable String id) {
		Team result = teamService.findById(id);
		return result;
	}

	@DeleteMapping("/deleteById/{id}")
	public void deleteById(@PathVariable String id) {
		teamService.deleteById(id);
	}

	@PostMapping("/save")
	public Team save(@RequestBody Team model) {
		Team result = teamService.save(model);
		return result;
	}

}
